<?php
	/**
	 * 跑马灯信息
	 */
	class Marquee extends APIBase {
		
		public $tag = "Marquee";
		public $isLogin = false;


		public function before() {
			$this->initCacheRedis();
			return true;
		}

		public function logic() {

			$marqids = $this->cache_redis->lRange("lmarq:ids", 0, -1);
			$marquees = array();
			foreach ($marqids as $mid) {
				$marq = $this->cache_redis->hMGet("hmarq:{$mid}", array("type", "content", "report_num"));
				$marq['marqid'] = (int) $mid;
				$marq['type'] = (int) $marq['type'];
				$marq['report_num'] = (int) $marq['report_num'];					
				$marquees[] = $marq;
			}
			$this->returnData(array('marquees' => $marquees));
						
		}

		public function after() {
			$this->deinitCacheRedis();
		}
		
    }
?>
